﻿using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using Gift.DBUtility;//Please add references
namespace Gift.DAL
{
    /// <summary>
    /// 数据访问类:DALCategoryAd
    /// </summary>
    public partial class DALCategoryAd
    {
        public DALCategoryAd()
        { }
        #region  Method
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from tbCategoryAd");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
					new SqlParameter("@id", SqlDbType.Int,4)
			};
            parameters[0].Value = id;

            return DbHelperSQL.Exists(strSql.ToString(), parameters);
        }


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Gift.Model.tbCategoryAd model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into tbCategoryAd(");
            strSql.Append("category,slidesLeft,slidesLeftAlt,slidesLeftUrl,slidesOne,slidesOneAlt,slidesOneUrl,slidesTwo,slidesTwoAlt,slidesTwoUrl,categoryOne,categoryOneAlt,categoryOneUrl,categoryTwo,categoryTwoAlt,categoryTwoUrl,categoryThree,categoryThreeAlt,categoryThreeUrl,categoryFour,categoryFourAlt,categoryFourUrl,middle,middleAlt,middleUrl)");
            strSql.Append(" values (");
            strSql.Append("@category,@slidesLeft,@slidesLeftAlt,@slidesLeftUrl,@slidesOne,@slidesOneAlt,@slidesOneUrl,@slidesTwo,@slidesTwoAlt,@slidesTwoUrl,@categoryOne,@categoryOneAlt,@categoryOneUrl,@categoryTwo,@categoryTwoAlt,@categoryTwoUrl,@categoryThree,@categoryThreeAlt,@categoryThreeUrl,@categoryFour,@categoryFourAlt,@categoryFourUrl,@middle,@middleAlt,@middleUrl)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
					new SqlParameter("@category", SqlDbType.UniqueIdentifier,16),
					new SqlParameter("@slidesLeft", SqlDbType.NVarChar,500),
					new SqlParameter("@slidesLeftAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@slidesLeftUrl", SqlDbType.NVarChar,500),
					new SqlParameter("@slidesOne", SqlDbType.NVarChar,500),
					new SqlParameter("@slidesOneAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@slidesOneUrl", SqlDbType.NVarChar,500),
					new SqlParameter("@slidesTwo", SqlDbType.NVarChar,500),
					new SqlParameter("@slidesTwoAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@slidesTwoUrl", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryOne", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryOneAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@categoryOneUrl", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryTwo", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryTwoAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@categoryTwoUrl", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryThree", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryThreeAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@categoryThreeUrl", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryFour", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryFourAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@categoryFourUrl", SqlDbType.NVarChar,500),
					new SqlParameter("@middle", SqlDbType.NVarChar,500),
					new SqlParameter("@middleAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@middleUrl", SqlDbType.NVarChar,500)};
            parameters[0].Value = model.category;
            parameters[1].Value = model.slidesLeft;
            parameters[2].Value = model.slidesLeftAlt;
            parameters[3].Value = model.slidesLeftUrl;
            parameters[4].Value = model.slidesOne;
            parameters[5].Value = model.slidesOneAlt;
            parameters[6].Value = model.slidesOneUrl;
            parameters[7].Value = model.slidesTwo;
            parameters[8].Value = model.slidesTwoAlt;
            parameters[9].Value = model.slidesTwoUrl;
            parameters[10].Value = model.categoryOne;
            parameters[11].Value = model.categoryOneAlt;
            parameters[12].Value = model.categoryOneUrl;
            parameters[13].Value = model.categoryTwo;
            parameters[14].Value = model.categoryTwoAlt;
            parameters[15].Value = model.categoryTwoUrl;
            parameters[16].Value = model.categoryThree;
            parameters[17].Value = model.categoryThreeAlt;
            parameters[18].Value = model.categoryThreeUrl;
            parameters[19].Value = model.categoryFour;
            parameters[20].Value = model.categoryFourAlt;
            parameters[21].Value = model.categoryFourUrl;
            parameters[22].Value = model.middle;
            parameters[23].Value = model.middleAlt;
            parameters[24].Value = model.middleUrl;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Gift.Model.tbCategoryAd model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update tbCategoryAd set ");
            strSql.Append("category=@category,");
            strSql.Append("slidesLeft=@slidesLeft,");
            strSql.Append("slidesLeftAlt=@slidesLeftAlt,");
            strSql.Append("slidesLeftUrl=@slidesLeftUrl,");
            strSql.Append("slidesOne=@slidesOne,");
            strSql.Append("slidesOneAlt=@slidesOneAlt,");
            strSql.Append("slidesOneUrl=@slidesOneUrl,");
            strSql.Append("slidesTwo=@slidesTwo,");
            strSql.Append("slidesTwoAlt=@slidesTwoAlt,");
            strSql.Append("slidesTwoUrl=@slidesTwoUrl,");
            strSql.Append("categoryOne=@categoryOne,");
            strSql.Append("categoryOneAlt=@categoryOneAlt,");
            strSql.Append("categoryOneUrl=@categoryOneUrl,");
            strSql.Append("categoryTwo=@categoryTwo,");
            strSql.Append("categoryTwoAlt=@categoryTwoAlt,");
            strSql.Append("categoryTwoUrl=@categoryTwoUrl,");
            strSql.Append("categoryThree=@categoryThree,");
            strSql.Append("categoryThreeAlt=@categoryThreeAlt,");
            strSql.Append("categoryThreeUrl=@categoryThreeUrl,");
            strSql.Append("categoryFour=@categoryFour,");
            strSql.Append("categoryFourAlt=@categoryFourAlt,");
            strSql.Append("categoryFourUrl=@categoryFourUrl,");
            strSql.Append("middle=@middle,");
            strSql.Append("middleAlt=@middleAlt,");
            strSql.Append("middleUrl=@middleUrl");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
					new SqlParameter("@category", SqlDbType.UniqueIdentifier,16),
					new SqlParameter("@slidesLeft", SqlDbType.NVarChar,500),
					new SqlParameter("@slidesLeftAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@slidesLeftUrl", SqlDbType.NVarChar,500),
					new SqlParameter("@slidesOne", SqlDbType.NVarChar,500),
					new SqlParameter("@slidesOneAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@slidesOneUrl", SqlDbType.NVarChar,500),
					new SqlParameter("@slidesTwo", SqlDbType.NVarChar,500),
					new SqlParameter("@slidesTwoAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@slidesTwoUrl", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryOne", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryOneAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@categoryOneUrl", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryTwo", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryTwoAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@categoryTwoUrl", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryThree", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryThreeAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@categoryThreeUrl", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryFour", SqlDbType.NVarChar,500),
					new SqlParameter("@categoryFourAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@categoryFourUrl", SqlDbType.NVarChar,500),
					new SqlParameter("@middle", SqlDbType.NVarChar,500),
					new SqlParameter("@middleAlt", SqlDbType.NVarChar,50),
					new SqlParameter("@middleUrl", SqlDbType.NVarChar,500),
					new SqlParameter("@id", SqlDbType.Int,4)};
            parameters[0].Value = model.category;
            parameters[1].Value = model.slidesLeft;
            parameters[2].Value = model.slidesLeftAlt;
            parameters[3].Value = model.slidesLeftUrl;
            parameters[4].Value = model.slidesOne;
            parameters[5].Value = model.slidesOneAlt;
            parameters[6].Value = model.slidesOneUrl;
            parameters[7].Value = model.slidesTwo;
            parameters[8].Value = model.slidesTwoAlt;
            parameters[9].Value = model.slidesTwoUrl;
            parameters[10].Value = model.categoryOne;
            parameters[11].Value = model.categoryOneAlt;
            parameters[12].Value = model.categoryOneUrl;
            parameters[13].Value = model.categoryTwo;
            parameters[14].Value = model.categoryTwoAlt;
            parameters[15].Value = model.categoryTwoUrl;
            parameters[16].Value = model.categoryThree;
            parameters[17].Value = model.categoryThreeAlt;
            parameters[18].Value = model.categoryThreeUrl;
            parameters[19].Value = model.categoryFour;
            parameters[20].Value = model.categoryFourAlt;
            parameters[21].Value = model.categoryFourUrl;
            parameters[22].Value = model.middle;
            parameters[23].Value = model.middleAlt;
            parameters[24].Value = model.middleUrl;
            parameters[25].Value = model.id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int id)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from tbCategoryAd ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
					new SqlParameter("@id", SqlDbType.Int,4)
			};
            parameters[0].Value = id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        /// <summary>
        /// 批量删除数据
        /// </summary>
        public bool DeleteList(string idlist)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from tbCategoryAd ");
            strSql.Append(" where id in (" + idlist + ")  ");
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Gift.Model.tbCategoryAd GetModel(int id)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 id,category,slidesLeft,slidesLeftAlt,slidesLeftUrl,slidesOne,slidesOneAlt,slidesOneUrl,slidesTwo,slidesTwoAlt,slidesTwoUrl,categoryOne,categoryOneAlt,categoryOneUrl,categoryTwo,categoryTwoAlt,categoryTwoUrl,categoryThree,categoryThreeAlt,categoryThreeUrl,categoryFour,categoryFourAlt,categoryFourUrl,middle,middleAlt,middleUrl from tbCategoryAd ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
					new SqlParameter("@id", SqlDbType.Int,4)
			};
            parameters[0].Value = id;

            Gift.Model.tbCategoryAd model = new Gift.Model.tbCategoryAd();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["id"] != null && ds.Tables[0].Rows[0]["id"].ToString() != "")
                {
                    model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["category"] != null && ds.Tables[0].Rows[0]["category"].ToString() != "")
                {
                    model.category = new Guid(ds.Tables[0].Rows[0]["category"].ToString());
                }
                if (ds.Tables[0].Rows[0]["slidesLeft"] != null && ds.Tables[0].Rows[0]["slidesLeft"].ToString() != "")
                {
                    model.slidesLeft = ds.Tables[0].Rows[0]["slidesLeft"].ToString();
                }
                if (ds.Tables[0].Rows[0]["slidesLeftAlt"] != null && ds.Tables[0].Rows[0]["slidesLeftAlt"].ToString() != "")
                {
                    model.slidesLeftAlt = ds.Tables[0].Rows[0]["slidesLeftAlt"].ToString();
                }
                if (ds.Tables[0].Rows[0]["slidesLeftUrl"] != null && ds.Tables[0].Rows[0]["slidesLeftUrl"].ToString() != "")
                {
                    model.slidesLeftUrl = ds.Tables[0].Rows[0]["slidesLeftUrl"].ToString();
                }
                if (ds.Tables[0].Rows[0]["slidesOne"] != null && ds.Tables[0].Rows[0]["slidesOne"].ToString() != "")
                {
                    model.slidesOne = ds.Tables[0].Rows[0]["slidesOne"].ToString();
                }
                if (ds.Tables[0].Rows[0]["slidesOneAlt"] != null && ds.Tables[0].Rows[0]["slidesOneAlt"].ToString() != "")
                {
                    model.slidesOneAlt = ds.Tables[0].Rows[0]["slidesOneAlt"].ToString();
                }
                if (ds.Tables[0].Rows[0]["slidesOneUrl"] != null && ds.Tables[0].Rows[0]["slidesOneUrl"].ToString() != "")
                {
                    model.slidesOneUrl = ds.Tables[0].Rows[0]["slidesOneUrl"].ToString();
                }
                if (ds.Tables[0].Rows[0]["slidesTwo"] != null && ds.Tables[0].Rows[0]["slidesTwo"].ToString() != "")
                {
                    model.slidesTwo = ds.Tables[0].Rows[0]["slidesTwo"].ToString();
                }
                if (ds.Tables[0].Rows[0]["slidesTwoAlt"] != null && ds.Tables[0].Rows[0]["slidesTwoAlt"].ToString() != "")
                {
                    model.slidesTwoAlt = ds.Tables[0].Rows[0]["slidesTwoAlt"].ToString();
                }
                if (ds.Tables[0].Rows[0]["slidesTwoUrl"] != null && ds.Tables[0].Rows[0]["slidesTwoUrl"].ToString() != "")
                {
                    model.slidesTwoUrl = ds.Tables[0].Rows[0]["slidesTwoUrl"].ToString();
                }
                if (ds.Tables[0].Rows[0]["categoryOne"] != null && ds.Tables[0].Rows[0]["categoryOne"].ToString() != "")
                {
                    model.categoryOne = ds.Tables[0].Rows[0]["categoryOne"].ToString();
                }
                if (ds.Tables[0].Rows[0]["categoryOneAlt"] != null && ds.Tables[0].Rows[0]["categoryOneAlt"].ToString() != "")
                {
                    model.categoryOneAlt = ds.Tables[0].Rows[0]["categoryOneAlt"].ToString();
                }
                if (ds.Tables[0].Rows[0]["categoryOneUrl"] != null && ds.Tables[0].Rows[0]["categoryOneUrl"].ToString() != "")
                {
                    model.categoryOneUrl = ds.Tables[0].Rows[0]["categoryOneUrl"].ToString();
                }
                if (ds.Tables[0].Rows[0]["categoryTwo"] != null && ds.Tables[0].Rows[0]["categoryTwo"].ToString() != "")
                {
                    model.categoryTwo = ds.Tables[0].Rows[0]["categoryTwo"].ToString();
                }
                if (ds.Tables[0].Rows[0]["categoryTwoAlt"] != null && ds.Tables[0].Rows[0]["categoryTwoAlt"].ToString() != "")
                {
                    model.categoryTwoAlt = ds.Tables[0].Rows[0]["categoryTwoAlt"].ToString();
                }
                if (ds.Tables[0].Rows[0]["categoryTwoUrl"] != null && ds.Tables[0].Rows[0]["categoryTwoUrl"].ToString() != "")
                {
                    model.categoryTwoUrl = ds.Tables[0].Rows[0]["categoryTwoUrl"].ToString();
                }
                if (ds.Tables[0].Rows[0]["categoryThree"] != null && ds.Tables[0].Rows[0]["categoryThree"].ToString() != "")
                {
                    model.categoryThree = ds.Tables[0].Rows[0]["categoryThree"].ToString();
                }
                if (ds.Tables[0].Rows[0]["categoryThreeAlt"] != null && ds.Tables[0].Rows[0]["categoryThreeAlt"].ToString() != "")
                {
                    model.categoryThreeAlt = ds.Tables[0].Rows[0]["categoryThreeAlt"].ToString();
                }
                if (ds.Tables[0].Rows[0]["categoryThreeUrl"] != null && ds.Tables[0].Rows[0]["categoryThreeUrl"].ToString() != "")
                {
                    model.categoryThreeUrl = ds.Tables[0].Rows[0]["categoryThreeUrl"].ToString();
                }
                if (ds.Tables[0].Rows[0]["categoryFour"] != null && ds.Tables[0].Rows[0]["categoryFour"].ToString() != "")
                {
                    model.categoryFour = ds.Tables[0].Rows[0]["categoryFour"].ToString();
                }
                if (ds.Tables[0].Rows[0]["categoryFourAlt"] != null && ds.Tables[0].Rows[0]["categoryFourAlt"].ToString() != "")
                {
                    model.categoryFourAlt = ds.Tables[0].Rows[0]["categoryFourAlt"].ToString();
                }
                if (ds.Tables[0].Rows[0]["categoryFourUrl"] != null && ds.Tables[0].Rows[0]["categoryFourUrl"].ToString() != "")
                {
                    model.categoryFourUrl = ds.Tables[0].Rows[0]["categoryFourUrl"].ToString();
                }
                if (ds.Tables[0].Rows[0]["middle"] != null && ds.Tables[0].Rows[0]["middle"].ToString() != "")
                {
                    model.middle = ds.Tables[0].Rows[0]["middle"].ToString();
                }
                if (ds.Tables[0].Rows[0]["middleAlt"] != null && ds.Tables[0].Rows[0]["middleAlt"].ToString() != "")
                {
                    model.middleAlt = ds.Tables[0].Rows[0]["middleAlt"].ToString();
                }
                if (ds.Tables[0].Rows[0]["middleUrl"] != null && ds.Tables[0].Rows[0]["middleUrl"].ToString() != "")
                {
                    model.middleUrl = ds.Tables[0].Rows[0]["middleUrl"].ToString();
                }
                return model;
            }
            else
            {
                return null;
            }
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select id,category,slidesLeft,slidesLeftAlt,slidesLeftUrl,slidesOne,slidesOneAlt,slidesOneUrl,slidesTwo,slidesTwoAlt,slidesTwoUrl,categoryOne,categoryOneAlt,categoryOneUrl,categoryTwo,categoryTwoAlt,categoryTwoUrl,categoryThree,categoryThreeAlt,categoryThreeUrl,categoryFour,categoryFourAlt,categoryFourUrl,middle,middleAlt,middleUrl ");
            strSql.Append(" FROM tbCategoryAd ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            return DbHelperSQL.Query(strSql.ToString());
        }

        public DataTable GetCategoryAdByCategory(string category)
        {
            DataTable table = new DataTable();
            try
            {
                string commandText = string.Format("select id,slidesLeft,slidesLeftAlt,slidesLeftUrl,slidesOneAlt,slidesOneUrl,slidesOne,slidesTwo,slidesTwoAlt,slidesTwoUrl,categoryOne,categoryOneAlt,categoryOneUrl,categoryTwo,categoryTwoAlt,categoryTwoUrl,categoryThree,categoryThreeAlt,categoryThreeUrl,categoryFour,categoryFourAlt,categoryFourUrl,middle,middleAlt,middleUrl from tbcategoryAd where category=@category", new object[0]);
                SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@category", category) };
                table = DbHelperSQL.Query(commandText, commandParameters).Tables[0];
            }
            catch
            {
            }
            return table;
        }



        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select ");
            if (Top > 0)
            {
                strSql.Append(" top " + Top.ToString());
            }
            strSql.Append(" id,category,slidesLeft,slidesLeftAlt,slidesLeftUrl,slidesOne,slidesOneAlt,slidesOneUrl,slidesTwo,slidesTwoAlt,slidesTwoUrl,categoryOne,categoryOneAlt,categoryOneUrl,categoryTwo,categoryTwoAlt,categoryTwoUrl,categoryThree,categoryThreeAlt,categoryThreeUrl,categoryFour,categoryFourAlt,categoryFourUrl,middle,middleAlt,middleUrl ");
            strSql.Append(" FROM tbCategoryAd ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            strSql.Append(" order by " + filedOrder);
            return DbHelperSQL.Query(strSql.ToString());
        }

        /// <summary>
        /// 获取记录总数
        /// </summary>
        public int GetRecordCount(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) FROM tbCategoryAd ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            object obj = DbHelperSQL.GetSingle(strSql.ToString());
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("SELECT * FROM ( ");
            strSql.Append(" SELECT ROW_NUMBER() OVER (");
            if (!string.IsNullOrEmpty(orderby.Trim()))
            {
                strSql.Append("order by T." + orderby);
            }
            else
            {
                strSql.Append("order by T.id desc");
            }
            strSql.Append(")AS Row, T.*  from tbCategoryAd T ");
            if (!string.IsNullOrEmpty(strWhere.Trim()))
            {
                strSql.Append(" WHERE " + strWhere);
            }
            strSql.Append(" ) TT");
            strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
            return DbHelperSQL.Query(strSql.ToString());
        }

        /*
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        {
            SqlParameter[] parameters = {
                    new SqlParameter("@tblName", SqlDbType.VarChar, 255),
                    new SqlParameter("@fldName", SqlDbType.VarChar, 255),
                    new SqlParameter("@PageSize", SqlDbType.Int),
                    new SqlParameter("@PageIndex", SqlDbType.Int),
                    new SqlParameter("@IsReCount", SqlDbType.Bit),
                    new SqlParameter("@OrderType", SqlDbType.Bit),
                    new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
                    };
            parameters[0].Value = "tbCategoryAd";
            parameters[1].Value = "id";
            parameters[2].Value = PageSize;
            parameters[3].Value = PageIndex;
            parameters[4].Value = 0;
            parameters[5].Value = 0;
            parameters[6].Value = strWhere;	
            return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
        }*/

        #endregion  Method
    }
}

